package interfaces.common;

/**
 * The class stores all the server settings.
 *
 * @author Manujlov Maxim
 */
public final class ServerSettings {
  /**
   * The server working directory.
   */
  private static String workingDir;

  /**
   * The function returns the server working directory.
   *
   * @return the server working directory
   */
  public static synchronized String getWorkingDir() {
    return workingDir;
  }

  /**
   * The function sets the server working directory.
   *
   * @param workingDir working directory
   */
  public static synchronized void setWorkingDir(String workingDir) {
    ServerSettings.workingDir = workingDir;
  }

  /**
   * The name of the users database file.
   */
  private static String usersDatabaseFileName;

  /**
   * The function returns the name of the users database file.
   *
   * @return the name of the users database file
   */
  public static synchronized String getUsersDatabaseFileName() {
    return usersDatabaseFileName;
  }

  /**
   * The function sets the name of the users database file.
   *
   * @param usersDatabaseFileName the name of the users database file
   */
  public static synchronized void setUsersDatabaseFileName(String usersDatabaseFileName) {
    ServerSettings.usersDatabaseFileName = usersDatabaseFileName;
  }

  static {
    // only for debug:
    workingDir = ".";
    usersDatabaseFileName = "users.txt";
  }
}
